<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="h" uri="/syzg-html"%>

<!DOCTYPE html>
<html>
	<head>
		<%@ include file="/base/jsp/common/CommonListTop.jsp"%>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>[栏目管理-数据列表]</title>
		<link href="${ctx}/base/css/base.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/base/css/common.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/base/css/${customTheme}.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/base/js/base.js" type="text/javascript"></script>
		<script src="${ctx}/base/js/common/FormFunction.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/plugins/jQuery/jQuery-2.2.0.min.js"></script>
		<link href="${ctx}/baseNew/bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<script src="${ctx}/baseNew/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    	<link href="${ctx}/baseNew/other/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
		<script src="${ctx}/baseNew/other/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
		<script src="${ctx}/baseNew/other/js/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
		<link rel="stylesheet" href="${ctx}/baseNew/dist/css/AdminLTE.min.css">
  		<link rel="stylesheet" href="${ctx}/baseNew/dist/css/skins/_all-skins.min.css">
  		<script src="${ctx}/baseNew/other/js/bootbox.min.js" type="text/javascript"></script>
  		<link rel="stylesheet" href="${ctx}/baseNew/validator/css/bootstrapValidator.css"/>
		<script type="text/javascript" src="${ctx}/baseNew/validator/js/bootstrapValidator.js"></script>
		<link rel="stylesheet" href="${ctx}/zenithsun/css/admin-imgList.css"/>
		<!-- 公用的按钮函数 -->
		<script>
			var addUrl = "${ctx}/path/newscolumns/initnewscolumns";//表单列表add 的url地址
			var delUrl = "${ctx}/path/newscolumns/delnewscolumns";//表单列表del的url地址
			var viewUrl = "${ctx}/path/newscolumns/viewnewscolumns";//表单列表view的url地址
			var editUrl = "${ctx}/path/newscolumns/editnewscolumns";//表单列表edit的url地址
			var listUrl = "${ctx}/path/newscolumns/listnewscolumns";//表单列表list 的url地址,用来作为搜索地址
			var saveAddUrl = "${ctx}/path/newscolumns/addnewscolumns";//表单列表save的url地址
			var saveEditUrl = "${ctx}/path/newscolumns/modnewscolumns";//表单列表save的url地址
 
			function defaultEvent(eventType,width,height) {
				FormFunction.defaultEvent(eventType,width,height);//默认的处理函数，需自定义时自己写 在PublicFunction.js里
			}
			//批量删除
			function deleteColumns(){
				if(confirm('您确定要删除吗？')){
					var selectedRecords = new Array();
					$("input:checkbox[name='selectedRow']:checked").each(function(index,record){
						selectedRecords.push($(this).val());
					});
					if(selectedRecords.length > 0){
						 $.ajax({  
		                        type:'post',  
		                        traditional :true,  
		                        url:'${ctx}/path/newscolumns/deleteByIds',  
		                        data:{'ids':selectedRecords},  
		                        success:function(data){  
		                            alert(data.content);
		                            location.reload();
		                        }  
		                    });  
					}else{
						alert("请选择删除的记录");
					}
				}
			}
/* 			function deleteRecord(id,number){
				if(number > 0){
					alert("该栏目下有"+number+"篇新闻，不能删除");
				}else{
					FormFunction.delSingle(id,url);
				}
			
			} */
		</script>
	</head>

	<body class="rightBody">
		<form name="searchForm" method="post" action="" class="form-inline">
			<table width="100%" class="title" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<th>
						<img src="${ctx}/zenithsun/images/back.png" width="26" height="26" alt="图标 " class="icon" />
						<em class="headTips">图片新闻网管理</em> &gt; 栏目管理
					</th>
					<th width="200"></th>
				</tr>
				<tr>
					<td>
						<!-- 
						<label class="control-label sr-only" for="searchValue_'Id'_">ID：</label>
						<input type="text" name="searchValue['id']" id="searchValue_Id" class="form-control input-sm" placeholder="ID..."/>&nbsp;
						 -->
						<label class="control-label sr-only" for="searchValue_'name'_">名称：</label>
						<input type="text" name="searchValue['name']" id="searchValue_name" class="form-control input-sm" placeholder="名称..."/>
						<!-- 
						<label class="control-label sr-only" for="searchValue_'parentId'_">父ID：</label>
						<input type="text" name="searchValue['parentId']" id="searchValue_parentId" class="form-control input-sm" placeholder="父ID..."/>&nbsp;
						-->
						<input type="button" value="搜索" class="btn btn-primary btn-sm" onclick="defaultEvent('search')" />
						<input name="" type="reset" value="重置" class="btn btn-primary btn-sm"  />
					</td>
					<td align="right">
						<input name="add" type="button" class="btn btn-primary btn-sm" value="新增" onclick="FormFunction.showAddModal()" />
						<input name="del" type="button" class="btn btn-primary btn-sm" value="删除" onclick="deleteColumns()" />
					</td>
				</tr>
			</table>
			<h:table cssClass="table table-bordered table-hover table-striped" cssStyle="margin-bottom:-5px;">
				<h:column headerTitle="<input type='checkbox' name='slectAll' value='checkbox' onclick='selectAll(this.checked);'>" align="center" width="2%">
					<input type="checkbox" name="selectedRow" value="${o.id }" />
				</h:column>
				
				<!-- generate code start -->
				<!--  
                <h:column headerTitle="ID" width="10%">
                    ${o.id}
                </h:column>
				
                <h:column headerTitle="父ID" width="10%">
                    ${o.parentId}
                </h:column>
				-->
				<h:column headerTitle="序号" width="5%">
                    ${o.orderNo}
                </h:column>
                <h:column headerTitle="名称" width="15%">
                    ${o.name}
                </h:column>
				<!-- 
                <h:column headerTitle="链接" width="15%">
                    ${o.url}
                </h:column>
 				-->
                <h:column headerTitle="备注" width="40%">
                    ${o.remark}
                </h:column>
                <h:column headerTitle="创建时间" width="15%">
                    <fmt:formatDate value="${o.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                </h:column>
				<!--  
                <h:column headerTitle="是否本网站">
                	<c:if test="${o.isThisWebsite=='1'}">是</c:if>
                    <c:if test="${o.isThisWebsite=='0'}">否</c:if>
                </h:column>
				
                <h:column headerTitle="封面图片" width="10%">
                	<img alt="${o.name}" src="${ctx}${o.coverPath}" width="50" height="50">
                </h:column>

                <h:column headerTitle="新闻描述" width="25%">
                    ${o.content}
                </h:column>
-->
				<!-- generate code end -->
				
				<h:column headerTitle="操作" align="center" width="10%">
					<a href="javascript:FormFunction.showEditModal('${o.id }');" class="linkorange">修改</a>
					<a href="javascript:FormFunction.delSingle('${o.id }');" class="linkorange">删除</a>
				</h:column>
			</h:table>
			<table width="100%" class="pageDown" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="right">
						<h:pager /> &nbsp;
					</td>
				</tr>
			</table>
		</form>
		<div id="myDlg"></div>
		<%@ include file="/base/jsp/common/CommonListFoot.jsp"%>
	</body>
</html>
